package com.bifrost.model.param;

import com.bifrost.validator.group.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * Author by yanxiaobo
 * Date on 2018/4/18$.
 */
@Setter
@Getter
public class PermissionParam {
    @NotNull(message = "更改时必须指定具体的主体",
            groups = {IndexUpdate.class, MenuUpdate.class, ButtonUpdate.class})
    private Integer menuId;

    @NotNull(message = "父级权限不能为空", groups = {
            MenuAdd.class, ButtonAdd.class,
            MenuUpdate.class, ButtonUpdate.class
    })
    private Integer parentId;

    @NotBlank(message = "名称不能为空")
    private String name;

    @NotBlank(message = "权限标识不可以为空",groups = {ButtonAdd.class,ButtonUpdate.class})
    private String identifier;//用于标识权限

    @Length(max = 255,message = "备注信息必须在255个字符以内")
    private String description;

    @NotBlank(message = "url不不能为空", groups = {MenuAdd.class, MenuUpdate.class})
    private String url;//对应权限的menuurl（页面url）

    @NotBlank(message = "授权标识不能为空", groups = {ButtonAdd.class, ButtonUpdate.class })
    private String perms;//该权限对应拦截的url

    @NotNull(message = "类型不能为空")
    private Integer type;

    @NotNull(message = "排序号不能为空")
    private Integer orderNum;//对应权限的order字段

    private String icon;

}
